from tkinter import *

root=Tk()

group=LabelFrame(root,text="最好的脚本语言是？",padx=5,pady=5)
group.pack(padx=10,pady=10)

LANGS=[
    ("python",1),
    ("js",2),
    ("lau",3),
    ("ruby",4)]

v=IntVar()
v.set(1)#默认选中第一个

for lang,num in LANGS:
    b=Radiobutton(group,text=lang,variable=v,value=num)
    # indicatoron=False是把单选框的圆圈去掉
    b.pack(anchor=W)
    # fill=X是横向填充，Y是竖向填充


mainloop()
